const express = require('express');
const { createProxyMiddleware } = require('http-proxy-middleware');
 
const app = express();
 
app.use('/api', createProxyMiddleware({ 
  target: 'http://apis.juhe.cn/simpleWeather', // 跨域目标接口
  changeOrigin: true 
}))

app.listen(3000);